<%@ Page Language="C#" AutoEventWireup="true" Theme="YUI" StylesheetTheme="YUI" CodeFile="PlacementCategories.aspx.cs"
    Inherits="Home_PlacementCategories" %>

<%@ Register Src="../UserControls/Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Placement Manager: Placement Categories</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="doc3" class="yui-t7">
            <div id="hd">
                <uc1:Menu ID="Menu1" runat="server" />
            </div>
            <div id="bd">
                <h1>
                    Manage Placement Categories</h1>
                <p>
                    Use this form to manage the broad categories into which placements can be categorised.
                    These categories are used for reporting purposes. Placement categories are specific
                    to Schools or Divisions.</p>
                <asp:GridView ID="gvCategories" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    DataSourceID="odsCategories" SkinID="Results" DataKeyNames="CategoryId" OnRowUpdating="gvCategories_RowUpdating"
                    AllowSorting="True">
                    <Columns>
                        <asp:CommandField ButtonType="Image" EditImageUrl="~/Images/Icons/edit.gif" ShowEditButton="True"
                            CancelImageUrl="~/Images/Icons/against.gif" UpdateImageUrl="~/Images/Icons/refresh.gif"
                            CausesValidation="False" />
                        <asp:BoundField DataField="CategoryName" HeaderText="Category Name" SortExpression="CategoryName" />
                        <asp:BoundField DataField="CreatedBy" HeaderText="Created By" SortExpression="CreatedBy"
                            ReadOnly="True" />
                        <asp:BoundField DataField="DateCreated" HeaderText="Date Created" ReadOnly="True"
                            SortExpression="DateCreated" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                        <asp:BoundField DataField="UpdatedBy" HeaderText="Updated By" SortExpression="UpdatedBy"
                            ReadOnly="True" />
                        <asp:BoundField DataField="DateUpdated" HeaderText="Date Updated" SortExpression="DateUpdated"
                            ReadOnly="True" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                        <asp:BoundField DataField="DivisionId" HeaderText="DivisionId" ReadOnly="True" SortExpression="DivisionId"
                            Visible="False" />
                        <asp:BoundField DataField="CategoryId" HeaderText="CategoryId" SortExpression="CategoryId"
                            ReadOnly="True" Visible="False" />
                    </Columns>
                    <EmptyDataTemplate>
                        No placement categories have been defined for this Division.
                    </EmptyDataTemplate>
                </asp:GridView>
                <hr style="height: 1px;" />
                <span class="formLabel">New Placement Category Name:</span>
                <asp:TextBox ID="txtNewCategoryName" runat="server"></asp:TextBox>&nbsp;<asp:Button
                    ID="btnAddNewCategory" runat="server" CssClass="inputbutton" OnClick="btnAddNewCategory_Click"
                    Text="Add New Category" />&nbsp;
                <asp:Label ID="lblNewCategoryMessage" runat="server"></asp:Label>
            </div>
            <div id="ft">
                Footer
            </div>
        </div>
        <!--Object Data Sources ************************************************* -->
        <asp:ObjectDataSource ID="odsCategories" runat="server" DeleteMethod="DeleteAllWDivisionId"
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="SelectAllWDivisionId"
            TypeName="PlacementManager.CategoryComponent" UpdateMethod="Update" DataObjectTypeName="PlacementManager.Category"
            SortParameterName="sortExpression">
            <SelectParameters>
                <asp:SessionParameter Name="DivisionId" SessionField="DivisionId" Type="Int32" />
                <asp:Parameter DefaultValue="CategoryName" Name="sortExpression" Type="String" />
            </SelectParameters>
            <InsertParameters>
                <asp:Parameter Name="CategoryName" Type="String" />
                <asp:Parameter Name="DivisionId" Type="Int32" />
                <asp:Parameter Name="IsActive" Type="Boolean" />
                <asp:Parameter Name="DateCreated" Type="DateTime" />
                <asp:Parameter Name="CreatedBy" Type="String" />
                <asp:Parameter Name="DateUpdated" Type="DateTime" />
                <asp:Parameter Name="UpdatedBy" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
    </form>
</body>
</html>
